package model.evaluate.mapper;

import model.evaluate.entity.Evaluate;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface EvaluateMapper {

    //    根据评价编号增加房屋评价表

    @Insert("insert into evaluate values(#{evaluateId},#{evaluateUsername},#{evaluateDetail},#{evaluateTime},#{evaluateImgs})")
    void save(Evaluate evaluate);

    //    根据用户编号删除房屋评价表
    @Delete("delete from evaluate where evaluate_username=#{evaluateUsername}")
    void  del(String evaluateUsername);
//    根据用户编号改房屋评价表

    @Update("update  evaluate set evaluateDetail = #{evaluateDetail} where evaluateId = #{evaluateId}")
    void update(Evaluate evaluate);
//    根据评价编号查房屋评价表

    @Select("select * from evaluate")
    List<Evaluate> findAll();

    @Select("select * from evaluate where evaluateId = #{evaluateId}")
    Evaluate findById(String evaluateId);


}
